﻿using BLL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Model;

namespace WebApi.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class MemberController : ControllerBase
    {
        public MemberController(Member_BLL bll)
        {
            Bll = bll;
        }

        public Member_BLL Bll { get; }

        /// <summary>
        /// 会员添加
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        [HttpPost("MemberAdd")]
        public IActionResult MemberAdd(Member_Model m)
        {
            var m1=Bll.MemberAdd(m);
            return Ok(new
            {
                data = m1
            });
        }
        /// <summary>
        /// 会员列表
        /// </summary>
        /// <param name="Name"></param>
        /// <param name="Phone"></param>
        /// <param name="SFZ"></param>
        /// <param name="KH"></param>
        /// <param name="CTime"></param>
        /// <returns></returns>
        [HttpGet("MemberShow")]
        public IActionResult MemberShow(string? Name, string? Phone, string? SFZ, string? KH)
        {

            var m = Bll.MemberShow(Name, Phone, SFZ, KH);
            return Ok(new
            {
                data = m
            });
        }
    }
}
